﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MDL;
using DAL;

namespace BLL
{
    public class BLL_ProductType
    {
        /// <summary>
        /// 获取商品类型信息
        /// </summary>
        /// <returns>商品类型信息</returns>
        public static List<ProductType> GetProductType()
        {
            return DAL_ProductType.GetProductType();
        }
        /// <summary>
        /// 查询是否已有商品类型名称
        /// </summary>
        /// <param name="name">商品类型名称</param>
        /// <returns>商品类型名称</returns>
        public static List<ProductType> SelectPTName(string name)
        {
            return DAL_ProductType.SelectPTName(name);
        }
        /// <summary>
        /// 增加商品类型名称
        /// </summary>
        /// <param name="name">类型名称</param>
        /// <returns>受影响的行数</returns>
        public static int AddPTName(string name)
        {
            return DAL_ProductType.AddPTName(name);
        }
        /// <summary>
        /// 根据商品类型ID删除商品类型
        /// </summary>
        /// <param name="ID">商品类型ID</param>
        /// <returns>受影响的行数</returns>
        public static int DeleteProductType(int ID)
        {
            return DAL_ProductType.DeleteProductType(ID);
        }
        /// <summary>
        /// 修改商品类型名称
        /// </summary>
        /// <param name="name">目标商品类型名称</param>
        /// <param name="ID">根据商品类型ID</param>
        /// <returns>受影响的行数</returns>
        public static int UpdateProductType(string name, int ID)
        {
            return DAL_ProductType.UpdateProductType(name, ID);
        }
    }
}
